Skip to content

Fix PDF report section chips not scrolling in Apple Preview - #13225

Open
benbowler wants to merge 6 commits into
developfrom
bug/13212-pdf-report-section-links-apple-preview
Open

Fix PDF report section chips not scrolling in Apple Preview#13225
benbowler wants to merge 6 commits into
developfrom
bug/13212-pdf-report-section-links-apple-preview

Conversation

@benbowler

@benbowler benbowler commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Related issue(s):

Relevant technical choices

  • patches/@react-pdf+render+4.5.1.patch
    • Writes node.box.left ?? 0 in setDestination, the expression react-pdf pull request 3460 uses.
  • assets/js/components/pdf-export/pdf-theme.ts
    • Scales PDF_PAGE_BOTTOM_PADDING from the design's 44 instead of the raw 60 points.
  • tests/playwright/specs/pdf-generation/pdf-generation-page.ts
    • Adds readPDFReport(), which reads the report with latin1, one character per byte.
  • tests/playwright/specs/pdf-generation/pdf-generation.spec.ts
    • Asserts the report holds (section-mainDashboardTraffic), and that no anchor reads /XYZ null.

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

🤖 This comment is automatically updated by CI workflows. Each section is managed independently.

🎭 Playwright reports for efc736c:

📚 Storybook for efc736c:

📦 Build files for efc736c:

@benbowler
benbowler marked this pull request as draft July 30, 2026 10:37
@benbowler benbowler changed the title Fix PDF report section links in Apple Preview [DRAFT] Fix PDF report section links in Apple Preview Jul 30, 2026
Apple Preview ignores a named destination's top coordinate when the
left one is unset, so the report's header chips scroll nowhere. The
patch writes `node.box.left ?? 0`, the expression react-pdf pull
request 3460 uses, so it can go once a release holds that fix.
The report case reads the downloaded report and asserts that every
section anchor holds a left coordinate. Dropping the patch now fails
the suite instead of passing without notice.
PDF_PAGE_BOTTOM_PADDING held a raw 60 points, which rendered about
twice the space the design leaves under the footer links. It now
scales the design's 44, and a Jest case pins that value.
@shervElmi
shervElmi force-pushed the bug/13212-pdf-report-section-links-apple-preview branch from 531babf to 35dd296 Compare August 9, 2026 22:46
@shervElmi shervElmi changed the title [DRAFT] Fix PDF report section links in Apple Preview Fix PDF report section links in Apple Preview Aug 9, 2026
@shervElmi shervElmi changed the title Fix PDF report section links in Apple Preview Fix PDF report section chips not scrolling in Apple Preview Aug 9, 2026
@shervElmi
shervElmi marked this pull request as ready for review August 9, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't click to section of PDF report + fix bottom spacing

2 participants